package com.hh.goodsmanage.util;

import com.hh.baseframework.util.statics.SysParam;

public class Sql {
	public static String monthChar_mysql = "SELECT DATE_FORMAT(OUT_GOODS_DATE,'%m') text,SUM(TOTAL_PRICE) data from goods_goodsmanage_out  WHERE DATE_FORMAT(OUT_GOODS_DATE,'%Y')=:year GROUP BY DATE_FORMAT(OUT_GOODS_DATE,'%m')";
	public static String outYear_mysql = "SELECT DISTINCT DATE_FORMAT(OUT_GOODS_DATE,'%Y') text,DATE_FORMAT(OUT_GOODS_DATE,'%Y') id  from goods_goodsmanage_out  ";

	public static String dayChar_mysql = "SELECT	DATE_FORMAT(OUT_GOODS_DATE, '%d') text,	SUM(TOTAL_PRICE) data FROM	goods_goodsmanage_out WHERE	DATE_FORMAT(OUT_GOODS_DATE, '%Y') = :year	AND DATE_FORMAT(OUT_GOODS_DATE, '%m') =:month  GROUP BY	DATE_FORMAT(OUT_GOODS_DATE, '%d')";

	public static String yearChar_mysql = "SELECT	DATE_FORMAT(OUT_GOODS_DATE, '%Y') text,	SUM(TOTAL_PRICE) data FROM	goods_goodsmanage_out GROUP BY 	DATE_FORMAT(OUT_GOODS_DATE, '%Y')";

	public static String getOutYear() {
		if (SysParam.DATABASE.equals("mysql")) {
			return outYear_mysql;
		} else {
			return null;
		}
	}

	public static String getMonthChar() {
		if (SysParam.DATABASE.equals("mysql")) {
			return monthChar_mysql;
		} else {
			return null;
		}
	}
	
	public static String getYearChar() {
		if (SysParam.DATABASE.equals("mysql")) {
			return yearChar_mysql;
		} else {
			return null;
		}
	}
	
	public static String getDayChar() {
		if (SysParam.DATABASE.equals("mysql")) {
			return dayChar_mysql;
		} else {
			return null;
		}
	}
}
